import org.codehaus.groovy.grails.commons.ApplicationHolder

class CSRFTagLib {

   
   def TokenBuilderService tokenBuilderService


  def CSRF = {

   // def grailsApp = ApplicationHolder.application
   //  TokenBuilderService builderService = (TokenBuilderService)grailsApp.mainContext.getBean("tokenBuilderService");

    def token = tokenBuilderService.buildToken()

    out << " <input type=\"hidden\" name=\"${token.name}\" value=\"${token.value}\" /> "
  }

}
